define [
], ->
  NumberUtils = number_format: (number, decimals, dec_point, thousands_sep) ->
    number = (number + "").replace(",", "").replace(" ", "")
    n = (if not isFinite(+number) then 0 else +number)
    prec = (if not isFinite(+decimals) then 0 else Math.abs(decimals))
    sep = (if (typeof thousands_sep is "undefined") then "," else thousands_sep)
    dec = (if (typeof dec_point is "undefined") then "." else dec_point)
    s = ""
    toFixedFix = (n, prec) ->
      k = Math.pow(10, prec)
      "" + Math.round(n * k) / k

    # Fix for IE parseFloat(0.55).toFixed(0) = 0;
    s = ((if prec then toFixedFix(n, prec) else "" + Math.round(n))).split(".")
    s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep)  if s[0].length > 3
    if (s[1] or "").length < prec
      s[1] = s[1] or ""
      s[1] += new Array(prec - s[1].length + 1).join("0")
    s.join dec